<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="FluidAppSettings" targetNamespace="http://schemas.microsoft.com/sharepoint/2009/fluidapp" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/sharepoint/2009/fluidapp" xmlns:mstns="http://schemas.microsoft.com/sharepoint/2009/fluidapp" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Guid SimpleType definition -->
    <xs:simpleType name="Guid">
        <xs:restriction base="xs:string"></xs:restriction>
    </xs:simpleType>

    <!-- MetaData definition -->
    <xs:complexType name="MetaData">
	<xs:all>
		<xs:element name="applicationId" type="Guid" minOccurs="1" maxOccurs="1" />
		<xs:element name="applicationUrl" type="xs:string" minOccurs="1" maxOccurs="1" />
		<xs:element name="principal" type="xs:string" minOccurs="1" maxOccurs="1" />
		<xs:element name="sharepointRequestHandlerUrl" type="xs:string" minOccurs="1" maxOccurs="1" />
	</xs:all>
    </xs:complexType>

    <!-- Property definition -->
    <xs:complexType name="Property" mixed="true">
        <xs:attribute name="name" type="xs:string" use="required" />
    </xs:complexType>

    <!-- Properties definition -->
    <xs:complexType name="WebPartProperties">
	<xs:sequence >
            <xs:element name="property" type="Property" minOccurs="0" maxOccurs="unbounded" />
	</xs:sequence>
    </xs:complexType>

    <!-- CustomProperties definition -->
    <xs:complexType name="CustomProperties">
	<xs:sequence >
            <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="skip" />
	</xs:sequence>
    </xs:complexType>

    <!-- Data definition -->
    <xs:complexType name="Data">
        <xs:all>
            <xs:element name="webPartProperties" type="WebPartProperties" minOccurs="0" maxOccurs="1" />
            <xs:element name="customProperties" type="CustomProperties" minOccurs="0" maxOccurs="1" />
        </xs:all>
    </xs:complexType>

    <!-- ApplicationPart definition -->
    <xs:complexType name="ApplicationPart">
        <xs:all>
            <xs:element name="metaData" type="MetaData" minOccurs="1" maxOccurs="1" />
            <xs:element name="data" type="Data" minOccurs="0" maxOccurs="1" />
        </xs:all>
    </xs:complexType>

    <!-- ApplicationPartCollection definition -->
    <xs:complexType name="ApplicationPartCollection">
        <xs:sequence>
            <xs:element name="applicationPart" type="ApplicationPart" minOccurs="1" maxOccurs="1" />
        </xs:sequence>
    </xs:complexType>

    <!-- This defines the Root XML element -->
    <xs:element name="applicationParts" type="ApplicationPartCollection"></xs:element>
</xs:schema>
